package io.renren.common.exception;

import io.renren.modules.impexp.controller.ResponseStatus;

/**
 * @description: 异常处理
 * @author: wurj
 * @Date: 2022/2/11 12:58:58
 */
public class CustomException extends BaseException{
    private ResponseStatus responseStatus;
    private Integer code;

    public CustomException(ResponseStatus responseStatus) {
        super(responseStatus);
        this.code = responseStatus.status();
        this.responseStatus = responseStatus;
    }

    public CustomException(ResponseStatus responseStatus, Throwable e) {
        super(responseStatus);
        this.code = responseStatus.status();
        this.responseStatus = responseStatus;
    }

    public CustomException(ResponseStatus responseStatus, String detailMessage) {
        super(responseStatus, detailMessage);
        this.code = responseStatus.status();
        this.responseStatus = responseStatus;
    }

    public ResponseStatus getResponseStatus() {
        return responseStatus;
    }

    public Integer getCode() {
        return code;
    }
}
